package com.ynr.user.service.impl;

import org.apache.shiro.authc.UsernamePasswordToken;

public class UseremailPasswordToken extends UsernamePasswordToken {

	private static final long serialVersionUID = 1L;
	
	private String email;
	
	public UseremailPasswordToken() {}

	public UseremailPasswordToken(String email) {
		this.email = email;
	}
	
	public UseremailPasswordToken(String email, String password) {
		this.email = email;
		super.setPassword(password.toCharArray());
	}
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Object getPrincipal() {
		return this.email;
	}

	public Object getCredentials() {
		return getPassword();
	}

	@Override
	public String toString() {
		return "UseremailPasswordToken [email=" + email + "]";
	}
	
}
